﻿using DevExpress.XtraReports.UI;

namespace ConfExpert.Utility
{
    public partial class ReportViewer : DevExpress.XtraEditors.XtraUserControl
    {
        XtraReport report = null;

        public XtraReport Report
        {
            get { return report; }
            set { report = value; }
        }


        public ReportViewer()
        {
            InitializeComponent();
        }

        public ReportViewer(XtraReport report)
            : this()
        {
            this.report = report;
        }


        public void View()
        {
            if (report != null)
            {
                printControl.PrintingSystem = report.PrintingSystem;
                report.CreateDocument(true);
            }

        }

        public void View(XtraReport report)
        {
            this.report = report;
            View();
        }
    }
}